From: Adel Gadllah Date: Sun, 16 Feb 2014 09:13:26 +0000 (+0100) Subject: altTab: Scale thumbnails by the scale factor X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2773 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3b7593ed7f4649977a3d659cf4285ad972fe8c30;p=gnome-shell.git altTab: Scale thumbnails by the scale factor Fixes their size on high dpi. https://bugzilla.gnome.org/show_bug.cgi?id=705410 --- diff --git a/js/ui/altTab.js b/js/ui/altTab.js index 57db134d8..e318375a2 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -655,17 +655,19 @@ const ThumbnailList = new Lang.Class({ totalPadding += this.actor.get_theme_node().get_horizontal_padding() + this.actor.get_theme_node().get_vertical_padding(); let [labelMinHeight, labelNaturalHeight] = this._labels[0].get_preferred_height(-1); let spacing = this._items[0].child.get_theme_node().get_length('spacing'); + let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; + let thumbnailSize = THUMBNAIL_DEFAULT_SIZE * scaleFactor; - availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, THUMBNAIL_DEFAULT_SIZE); + availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, thumbnailSize); let binHeight = availHeight + this._items[0].get_theme_node().get_vertical_padding() + this.actor.get_theme_node().get_vertical_padding() - spacing; - binHeight = Math.min(THUMBNAIL_DEFAULT_SIZE, binHeight); + binHeight = Math.min(thumbnailSize, binHeight); for (let i = 0; i < this._thumbnailBins.length; i++) { let mutterWindow = this._windows[i].get_compositor_private(); if (!mutterWindow) continue; - let clone = _createWindowClone(mutterWindow, THUMBNAIL_DEFAULT_SIZE); + let clone = _createWindowClone(mutterWindow, thumbnailSize); this._thumbnailBins[i].set_height(binHeight); this._thumbnailBins[i].add_actor(clone); this._clones.push(clone);